package com.h2cloud.innerClass;

/**
 * @Package: com.h2cloud.innerClass
 * @ClassName: Demo02LoggerLambda
 * @Author: wulongkai
 * @CreateTime: 2024/12/9 17:00
 * @Description:
 */
public class Demo02LoggerLambda {
    private static void log(int level, MessageBuilder builder) {
        if (level == 1) {
            System.out.println(builder.buildMessage());
        }
    }

    public static void main(String[] args) {
        String msgA = "Hello";
        String msgB = "World";
        String msgC = "Java";
        log(1, () -> msgA + msgB + msgC);
    }
}
